<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>System Tools</title>
	<{include file="system/header.tpl"}>
	<style>
	
	</style>
</head>
<body>
<{include file="system/nav.tpl"}>

<div class="container" role="main">
	<div class="page-header">
		<h1>脚手架</h1>
	</div>
	<div class="row">
	<form role="form" action="<{'wizard/fields'}>" method="POST">
		<div class="form-group">
			<label for="model_name">模块名称：</label>
			<input type="text" name="model_name" id="model_name" class="form-control" value="" placeholder="请输入模块名称，英文">
		</div>
		<div class="form-group">
			<label for="table_name">主表：</label>
			<select name="table_name" id="table_name" class="form-control">
				<option value="">请选择主表</option>
				<{foreach $_table_list as $item}><option value="<{$item|escape}>"><{$item|escape}></option><{/foreach}>
			</select>
		</div>
		<div class="form-group">
			<label for="subtable_name">子表：</label>
			<select name="subtable_name[]" id="subtable_name" class="form-control" size="5" multiple="multiple">
				<{foreach $_table_list as $item}><option value="<{$item|escape}>"><{$item|escape}></option><{/foreach}>
			</select>
			<span class="help-block">(*) <small>按住<kbd><kbd>Ctrl</kbd>+<kbd>左键</kbd></kbd>，多选/取消</small></span>
		</div>
		<div class="form-group">
			<button type="submit" class="btn btn-info">下一步&gt;&gt;</button>
		</div>
	</form>
	</div>
	<p></p>
	<p></p>
</div>
<{include file="system/footer.tpl"}>
<script type="text/javascript">
(function($){
	$().ready(function(){
		$('li.nav-wizard','#navigation').addClass('active');
		$('a[method]').query();
		
		$('#table_name').on('change',function(){
			var val = $(this).val() + '_';
			$('option','#subtable_name').prop({'disabled':true,'selected':false}).hide().each(function(){
				if (this.value.toString().indexOf(val) == 0)
					$(this).prop({'disabled':false}).show();
			});
		}).trigger('change');
	});
})(jQuery);
</script>
</body>
</html>